<template>
  <div class="header-nav-dropdown-wrapper">
    <ul class="ul-dropdown-list">
      <li v-for="item in WORK_LIST" :key="item.value" class="item item-service" @click.stop="navClick(item)">
        <div class="item-title">{{ item.title }}</div>
        <div class="item-text">{{ item.text }}</div>
      </li>
    </ul>
  </div>
</template>

<script>
import { WORK_LIST } from './navmenu.data';
import { mapGetters } from 'vuex';

export default {
  data () {
    return {
      WORK_LIST
    };
  },
  computed: {
    ...mapGetters({
      contexInfo: 'contexInfo'
    })
  },
  methods: {
    navClick (item) {
      const VINTEXroleId = this.contexInfo.roleIds;
      const index = VINTEXroleId.indexOf('JGGLY');
      const loginType = localStorage.getItem('VINTEX_login');
      if (loginType === '"6_V"' && index >= 0) {
        this.$emit('nav-click', item);
      } else {
        this.$notify({
          title: '没有权限',
          type: 'error'
        });
      }
    }
  }
};
</script>
<style lang="scss" scoped>
@import '@/styles/header.nav.scss';

.item-service {
  width: 210px !important;
}
</style>
